package com.futurescale.sa
{
	import com.futurescale.sa.controller.command.StartupCommand;
	import com.futurescale.sa.controller.constant.AppConstants;
	
	import org.puremvc.as3.patterns.facade.Facade;
	
	public class ApplicationFacade extends Facade
	{
		/**
		 * The Singleton instance factory method.
		 */
		public static function getInstance( ) :ApplicationFacade {
			if ( instance == null ) instance  = new ApplicationFacade( );
			return instance as ApplicationFacade;
		}
		
		/**
		 * Initialize the Controller and Register the Commands.
		 */
		override protected function initializeController() :void {
			super.initializeController();
			registerCommand( AppConstants.STARTUP, StartupCommand );
			
			// Register the rest of the Commands incrementally later... 
			// .
			// .
			// .
			
		}
		
		/**
		 * A convenience method for starting up the PureMVC 
		 * apparatus from the application.
		 */
		public function startup( app :StoryArchitect ) :void {
			sendNotification( AppConstants.STARTUP, app );
		}
	}
}